home *** CD-ROM | disk | FTP | other *** search
- Path: qualcomm.com!usenet
- From: nabbasi@qualcomm.com (Nasser Abbasi)
- Newsgroups: comp.lang.c++,comp.unix.programmer
- Subject: Re: c++ static objects and fork
- Date: 9 Feb 1996 06:00:56 GMT
- Organization: QUALCOMM
- Message-ID: <4fenuo$fg0@qualcomm.com>
- References: <4e8qu5$cmb@news02.comp.pge.com>
- NNTP-Posting-Host: nabbasi.qualcomm.com
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.93.14
-
- In article <4e8qu5$cmb@news02.comp.pge.com>, psk3@pge.com says...
- >
- >Here's a simple question, hopefully with a simple answer:
- >
- > I have a program which turns itself into a daemon using fork
- (etc.),
- >but I also have several static objects within the program. What happens
- to
- >these objects after the fork? There is no exec, so they dont get
- created anew,
- >at least I guess this is the case...
- > Anyone have this figured out? BTW, system is HPUX v 9.04.
- >
-
- Well, not sure what you are asking, let me ramble for little, may I say
- something of use to you...
-
- when a process forks, an excat copy of the process address space of the
- parent get created for the forked process. so it seems to me that at the
- instant the fork is completed, the child and the parent processes will
- have access to the objects. Now a daemon I think is a process that has
- no parent (poor process) i.e. Parent id of 1, but it will still have its
- own copy of the objects.. so things should work ok..
-
- I am not sure if I am answering your question really.
-
- Nasser
-
- the parent
-
-